package org.gaojianqiao.electronichandbook.provider;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;
import org.gaojianqiao.electronichandbook.createtable.SearchHistoryTab;
import org.gaojianqiao.electronichandbook.createtable.TreeView;

public class TreeViewProvider implements ITableLabelProvider
{

	@Override
	public void addListener(ILabelProviderListener listener)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void dispose( )
	{
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isLabelProperty(Object element, String property)
	{
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void removeListener(ILabelProviderListener listener)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public Image getColumnImage(Object element, int columnIndex)
	{
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getColumnText(Object element, int columnIndex)
	{
		// TODO Auto-generated method stub
		TreeView Tree = (TreeView) element;
		if (columnIndex == 0)
		{
			return Tree.getid();
		}
		if (columnIndex == 1)
		{
			return Tree.gettitle();
		}
		if (columnIndex == 2)
		{
			return Tree.getmhasparent();
		}

		if (columnIndex == 3)
		{
			return Tree.getmhaschild();
		}

		if (columnIndex == 4)
		{
			return Tree.getparent();
		}
		if (columnIndex == 5)
		{
			return Tree.getlevel();
		}
		if (columnIndex == 6)
		{
			return Tree.getexpanded();
		}
		return "";

	}
}
